package com.caregiver.watch.business.data.service;

import com.caregiver.watch.business.data.model.po.HealthBaseData;
import com.caregiver.watch.business.data.model.po.HealthDeviceLocation;
import com.caregiver.watch.business.data.model.po.SportData;
import com.caregiver.watch.business.data.protobuf.HisDataOuterClass;
import com.caregiver.watch.business.data.protobuf.HisEcgData;
import com.caregiver.watch.business.data.protobuf.HisHealthData;
import com.caregiver.watch.business.data.protobuf.HisRriData;
import com.caregiver.watch.business.data.protobuf.RealtimeData;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @Description: 监控数据服务
 * @Author 疆戟
 * @Date 2025/9/12 20:45
 * @Version 1.0
 */
public interface HealthDataService {

    /**
     * 插入健康数据
     *
     * @param health  健康数据
     * @param deviceUuId 设备ID
     * @param userId      用户ID
     * @param dataTime
     */
    void insertHealthData(RealtimeData.RtHealth health, String deviceUuId, Long userId, LocalDateTime dataTime);
    /**
     * 保存运动数据
     *
     * @param healthData
     * @param deviceUuId 设备ID
     */
    void insertSportData(HisHealthData.HisDataHealth healthData,
                         String deviceUuId,
                         Long userId,
                         LocalDateTime dataTime);


    /**
     * 插入心率数据
     *
     * @param healthData
     * @param deviceUuId 设备ID
     */
    void insertHeartRateData(HisHealthData.HisDataHealth healthData,
                             String deviceUuId,
                             Long userId,
                             LocalDateTime dataTime);

    /**
     * 插入血氧数据
     *
     * @param healthData
     * @param deviceUuId 设备ID
     */
    void insertBloodOxygen(HisHealthData.HisDataHealth healthData,
                           String deviceUuId,
                           Long userId,
                           LocalDateTime dataTime);

    /**
     * 插入血压数据
     * @param healthData
     * @param deviceUuId
     * @param userId
     * @param dataTime
     */
    void insertBpData(HisHealthData.HisDataHealth healthData,
                      String deviceUuId,
                      Long userId,
                      LocalDateTime dataTime);


    /**
     * 插入疲劳数据
     * @param healthData
     * @param deviceUuId
     * @param userId
     * @param dataTime
     */
    void insertFatigueData(HisHealthData.HisDataHealth healthData,
                           String deviceUuId,
                           Long userId,
                           LocalDateTime dataTime);

    /**
     * 插入体温数据
     * @param healthData
     * @param deviceUuId
     * @param userId
     * @param dataTime
     */
    void insertTemperatureData(HisHealthData.HisDataHealth healthData,
                               String deviceUuId,
                               Long userId,
                               LocalDateTime dataTime);

    /**
     * 插入血压心率
     * @param healthData
     * @param deviceUuId
     * @param userId
     * @param dataTime
     */
    void insertBpHeartRateData(HisHealthData.HisDataHealth healthData,
                               String deviceUuId,
                               Long userId,
                               LocalDateTime dataTime);


    /**
     * 插入心电数据
     * @param ecgData
     * @param deviceUuId
     * @param userId
     * @param dataTime
     */
    void insertEcgData(HisEcgData.HisDataECG ecgData,
                       String deviceUuId,
                       Long userId,
                       LocalDateTime dataTime);


    /**
     * 插入睡眠原始数据
     * @param hisData
     * @param deviceUuId
     * @param userId
     * @param dataTime
     */
    void insertSleepData(HisDataOuterClass.HisData hisData,
                         String deviceUuId,
                         Long userId,
                         LocalDateTime dataTime);

    /**
     * 批量保存定位数据
     * @param deviceLocations 定位数据
     */
    void insertGnssData(List<HealthDeviceLocation> deviceLocations);


    /**
     * 插入RRI数据
     * @param rri
     * @param deviceUuId
     * @param userId
     * @param dataTime
     */
    void insertRriData(HisRriData.HisDataRRI rri, String deviceUuId, Long userId, LocalDateTime dataTime);
}
